<?php require_once('../../g-config/konek.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "index.php?stat=logout";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

if ((isset($_GET['idplug_review'])) && ($_GET['idplug_review'] != "")) {
  $deleteSQL = sprintf("DELETE FROM plug_review WHERE id=%s",
                       GetSQLValueString($_GET['idplug_review'], "int"));

  mysql_select_db($database_konek, $konek);
  $Result1 = mysql_query($deleteSQL, $konek) or die(mysql_error());

  $deleteGoTo = "plugin_review.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}

$colname_admin = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_admin = $_SESSION['MM_Username'];
}
mysql_select_db($database_konek, $konek);
$query_admin = sprintf("SELECT * FROM data_user WHERE nama_user = %s", GetSQLValueString($colname_admin, "text"));
$admin = mysql_query($query_admin, $konek) or die(mysql_error());
$row_admin = mysql_fetch_assoc($admin);
$totalRows_admin = mysql_num_rows($admin);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Geriloji Admin</title>
<link href='http://geriloji.com/images/log.png' rel='shortcut icon'/>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,700,700italic">
<link rel="stylesheet" href="<?php echo $base_url ?>/g-admin/konten/bootstrap-1.4.css">
<link rel="stylesheet" href="<?php echo $base_url ?>/g-admin/konten/plugins-1.4.css">
<link rel="stylesheet" href="<?php echo $base_url ?>/g-admin/konten/main-1.4.css">
<link rel="stylesheet" href="<?php echo $base_url ?>/g-admin/awesome/css/font-awesome.min.css">
<link id="theme-link" rel="stylesheet" href="<?php echo $base_url ?>/g-admin/konten/river.css">
<link rel="stylesheet" href="<?php echo $base_url ?>/g-admin/konten/themes-1.4.css">
<script type="text/javascript" async src="<?php echo $base_url ?>/g-admin/konten/ga.js"></script><script src="<?php echo $base_url ?>/g-admin/konten/modernizr-2.6.2-respond-1.3.0.min.js"></script><style type="text/css"></style>
</head>
<body class="header-fixed-top" style="">
<?php include "menu.php" ?>
<div id="page-container">
<?php include "head.php" ?>
<div id="fx-container" class="fx-opacity">
  <div id="page-content" class="block">
   <?php include "menuatas.php" ?>
    <ul class="breadcrumb breadcrumb-top">
<li><i class="fa fa-coffee"></i></li>
<li><a href="">Dashboard</a></li>
</ul>
  </div>

<!--[if IE 8]><script src="js/helpers/excanvas.min.js"></script><![endif]-->
<footer class="clearfix">
<div class="pull-right"></div>
<div class="pull-left">
<span id="year-copy">2014</span> © CMS Geriloji</div>
</footer>
</div>
</div>
<a href="javascript:void(0)" id="to-top" style="display: none;"><i class="fa fa-angle-up"></i></a>
<script src="<?php echo $base_url ?>/g-admin/konten/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/vendor/jquery-1.10.2.min.js"%3E%3C/script%3E'));</script>
<script src="<?php echo $base_url ?>/g-admin/konten/bootstrap.min-1.4.js"></script>
<script src="<?php echo $base_url ?>/g-admin/konten/plugins-1.4.js"></script>
<script src="<?php echo $base_url ?>/g-admin/konten/main-1.4.js"></script><script>$(function(){$('#modal-layouts').modal({show: true});$(".timeline-con").slimScroll({height:565,color:"#000000",size:"3px",touchScrollStep:100,distance:"0"}),$(".timeline").css("min-height","565px");var e=$("#status-update"),t="";$("#accept-request").click(function(){$(this).replaceWith('<span class="label label-success">Awesome, you became friends!')}),$("#status-update-btn").click(function(){t=e.val(),t&&($(".timeline-con").slimScroll({scrollTo:"0px"}),$(".timeline").prepend('<li class="animation-pullDown"><div class="timeline-item"><h4 class="timeline-title"><small class="timeline-meta">just now</small><i class="fa fa-file"></i> Status</h4><div class="timeline-content"><p>'+$("<div />").text(t).html().substring(0,200)+"</p><em>Demo functionality</em></div>"+"</div>"+"</li>"),e.val("").attr("placeholder","I hope you like it! :-)"))});var n=$("#chart-classic"),i=[[0,60],[1,100],[2,80],[3,84],[4,124],[5,90],[6,150]],a=[[0,30],[1,50],[2,40],[3,42],[4,62],[5,45],[6,75]];$.plot(n,[{data:i,lines:{show:!0,fill:!0,fillColor:{colors:[{opacity:.25},{opacity:.25}]}},points:{show:!0,radius:7}},{data:a,lines:{show:!0,fill:!0,fillColor:{colors:[{opacity:.15},{opacity:.15}]}},points:{show:!0,radius:7}}],{colors:["#f39c12","#2e3030"],legend:{show:!1},grid:{borderWidth:0,hoverable:!0,clickable:!0},yaxis:{show:!1},xaxis:{show:!1}});var r=null,o=null;n.bind("plothover",function(e,t,n){if(n){if(r!==n.dataIndex){r=n.dataIndex,$("#chart-tooltip").remove();var i=(n.datapoint[0],n.datapoint[1]);o=1===n.seriesIndex?"<strong>"+i+"</strong> sales":"$ <strong>"+i+"</strong>",$('<div id="chart-tooltip" class="chart-tooltip">'+o+"</div>").css({top:n.pageY-45,left:n.pageX+5}).appendTo("body").show()}}else $("#chart-tooltip").remove(),r=null})});</script>
<script>var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-16158021-6"]),_gaq.push(["_setDomainName","pixelcave.com"]),_gaq.push(["_trackPageview"]),function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}();</script>

</body>
</html>
<?php
mysql_free_result($admin);
?>
